﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="MyAccount.aspx.cs" Inherits="MyAccount" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>My account</title>
    <style type="text/css">
        .style1
        {
            width: 278px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="Server">
    <h1>
        My account</h1>
    <h2>
        Change password</h2>
    <table>
        <tr>
            <td>
                Old password
            </td>
            <td class="style1">
                <asp:TextBox ID="txtOldPass" runat="server" OnTextChanged="txtOldPass_TextChanged"
                    TextMode="Password" ValidationGroup="1"></asp:TextBox>
                <asp:Label ID="lblMessage" runat="server" Text="Old password is wrong" 
                    Visible="False" ForeColor="Red"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                New password
            </td>
            <td class="style1">
                <asp:TextBox ID="txtNewPass" runat="server" TextMode="Password" 
                    ValidationGroup="1"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rqvNewPass" runat="server" 
                    ControlToValidate="txtNewPass" ErrorMessage="Please enter new password" 
                    ForeColor="Red" ValidationGroup="1"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                Confirm password
            </td>
            <td class="style1">
                <asp:TextBox ID="txtConfirmPass" runat="server" TextMode="Password" 
                    ValidationGroup="1"></asp:TextBox>
                <asp:CompareValidator ID="cvdConfirmPass" runat="server" 
                    ControlToCompare="txtNewPass" ControlToValidate="txtConfirmPass" 
                    ErrorMessage="Confirm pass doesn't match" ForeColor="Red" ValidationGroup="1"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btnSavePass" runat="server" Text="Save password change" 
                    OnClick="btnSavePass_Click" ValidationGroup="1" />
            </td>
        </tr>
    </table>
    <h2>
        Basic informations</h2>
    <table>
        <tr>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                First name
            </td>
            <td>
                <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Last name
            </td>
            <td>
                <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Email
            </td>
            <td>
                <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Address
            </td>
            <td>
                <asp:TextBox ID="txtAddress" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Card type
            </td>
            <td>
                <asp:DropDownList ID="drpCardType" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Card number
            </td>
            <td>
                <asp:TextBox ID="txtCardNum" runat="server" ValidationGroup="2"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rqvCardNum" runat="server" 
                    ControlToValidate="txtCardNum" ErrorMessage="Enter card-num!" ForeColor="Red"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="revCardNum" runat="server" 
                    ControlToValidate="txtCardNum" 
                    ErrorMessage="Please enter card-num as a number (d5)" ForeColor="Red" 
                    ValidationExpression="\d{5}" ValidationGroup="2"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="btnSaveInfo" runat="server" Text="Save user information" 
                    onclick="btnSaveInfo_Click" ValidationGroup="2" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblResult" runat="server" Text="Label" Visible="false"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>
